<?php
declare(strict_types=1);

namespace SixShop\WechatPay\Enum;

/**
 * 微信转账账单状态枚举
 */
enum TransferBillStatusEnum: string
{
    case APPLYING = 'APPLYING';              // 申请中
    case ACCEPTED = 'ACCEPTED';              // 转账已受理
    case PROCESSING = 'PROCESSING';          // 转账锁定资金中
    case WAIT_USER_CONFIRM = 'WAIT_USER_CONFIRM'; // 待收款用户确认
    case TRANSFERING = 'TRANSFERING';        // 转账中
    case SUCCESS = 'SUCCESS';                // 转账成功
    case FAIL = 'FAIL';                      // 转账失败
    case CANCELING = 'CANCELING';            // 转账撤销中
    case CANCELLED = 'CANCELLED';            // 转账撤销完成

    public function toString(): string
    {
        return match ($this) {
            self::APPLYING => '申请中',
            self::ACCEPTED => '转账已受理',
            self::PROCESSING => '转账锁定资金中',
            self::WAIT_USER_CONFIRM => '待收款用户确认',
            self::TRANSFERING => '转账中',
            self::SUCCESS => '转账成功',
            self::FAIL => '转账失败',
            self::CANCELING => '转账撤销中',
            self::CANCELLED => '转账撤销完成',
        };
    }
}